﻿@model  Vms.Web.Models.PROGRAM  
@{
    string startAging = "";
    string endAging = "";
    string startTime = "";
    string endTime = "";
    if(Model != null) {
        startAging += Model.StartDay + "/" + Model.StartMonth + "/" + Model.StartYear;
        endAging += Model.EndDay + "/" + Model.EndMonth + "/" + Model.EndYear;
        startTime += Model.StartHour + ":" + Model.StartMinute;
        endTime += Model.EndHour + ":" + Model.EndMinute;
    }
}
<div class="program-form">
    <div class="control-group" style="margin-top: 10px; margin-left: 13px;">
        <div class="editor-label">
             @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>
           
    </div>
    <div class="control-group" style="margin-top: 10px; margin-left: 13px;">
    </div>
    <fieldset>
        <legend>Play Aging
            <input type="checkbox" name="chk_group" value="value1" /></legend>
        <div >
            <div style="width: 200px; float: left">
                <div class="editor-label">
                    @Html.LabelFor(model => model.StartYear)
                </div>
                <div class="editor-field">
                    <input type="text" id="startAging_datepicker" name="StartAging" readonly value="@startAging" />
                    <!-- @Html.EditorFor(model => model.StartYear) -->
                    <!-- @Html.ValidationMessageFor(model => model.StartYear) -->
                </div>
            </div>
            <div style="margin-left: 200px;">
                <div class="editor-label">
                    @Html.LabelFor(model => model.EndYear)
                </div>
                <div class="editor-field">
                    <input type="text" id="endAging_datepicker" name="EndAging" readonly value="@startAging" />
                    <!-- @Html.EditorFor(model => model.EndYear) -->
                    <!-- @Html.ValidationMessageFor(model => model.EndYear) -->
                </div>
            </div>
        </div>
    </fieldset>
    <fieldset>
        <legend>Playing Time
            <input type="checkbox" name="chk_group" value="value1" /></legend>
        <div>
            <div style="width: 200px; float: left">
                <div class="editor-label">
                    @Html.LabelFor(model => model.StartHour)
                </div>
                <div class="editor-field">
                    <input type="text" id="startTime_timepicker" name="StartTime" value="@startTime" readonly />
                    <!-- @Html.EditorFor(model => model.StartHour) -->
                    <!-- @Html.ValidationMessageFor(model => model.StartHour) -->
                </div>
            </div>
            <div style="margin-left: 200px;">
                <div class="editor-label">
                    @Html.LabelFor(model => model.EndHour)
                </div>
                <div class="editor-field">
                    <input type="text" id="endTime_timepicker" name="EndTime" value="@endTime" readonly />
                    <!-- @Html.EditorFor(model => model.EndHour) -->
                    <!-- @Html.ValidationMessageFor(model => model.EndHour) -->
                </div>
            </div>
        </div>
    </fieldset>
    <fieldset >
        <legend>Play Weekly  <input type="checkbox" name="chk_group" value="value1" /></legend>
    <div style="padding-left:50px;">
        <span>      @Html.CheckBox("MonPlay", (Model != null && Model.MonPlay != null && (bool)Model.MonPlay)) Mon.</span>
        <span>      @Html.CheckBox("TuePlay", (Model != null && Model.TuePlay != null && (bool)Model.TuePlay)) Tue.</span>
        <span>      @Html.CheckBox("WedPlay", (Model != null && Model.WedPlay != null && (bool)Model.WedPlay)) Wed.</span>
        <span>      @Html.CheckBox("ThuPlay", (Model != null && Model.ThuPlay != null && (bool)Model.ThuPlay)) Thu.</span>
        <span>      @Html.CheckBox("FriPlay", (Model != null && Model.FriPlay != null && (bool)Model.FriPlay)) Fri.</span>
        <span>      @Html.CheckBox("SatPlay", (Model != null && Model.SatPlay != null && (bool)Model.SatPlay)) Sat.</span>
        <span>      @Html.CheckBox("SunPlay", (Model != null && Model.SunPlay != null && (bool)Model.SunPlay)) Sun.</span>
    </div>    
    </fieldset>
    <div class="btn-bar">
                        
                        <input type="submit" class="btn btn-primary" value="Save" />
                        @if (Model != null)
                        {
                            @Html.ActionLink("Delete", "DeleteProgram", new { programId = Model.Id}, new {@class = "btn btn-primary" })
                        }
                        @Html.ActionLink("Cancel", "Index", null, new { @class = "btn btn-primary" })
                    </div>
</div> <!--end div #program-form -->
